package org.example.util;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * REST结果封装类
 */
@Data
@AllArgsConstructor
public class RestResult {

    private String code;
    private String msg;
    private Object data;

    public static RestResult success(String message) {
        return new RestResult("000000", message, null);
    }

    public static RestResult failure(String code, String message) {
        return new RestResult(code, message, null);
    }

    public static RestResult failure(String code, String message, Object data) {
        return new RestResult(code, message, data);
    }
}